package study.springcloud.breaker.sentinel.controller._2_degrade;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.springcloud.breaker.sentinel.client.UserClient;
import study.eggs.result.Result;
import study.eggs.result.Results;

@Slf4j
@RestController
public class _2_DegradeController {

    @Autowired
    private UserClient userClient;

    @RequestMapping("/degrade2")
    public Result echo(long sec) {
        UserClient.UserInfo userInfo = userClient.getUserInfo(sec);
        return Results.ok(userInfo);
    }
}
